targer = gameapi
tree = behaviortree
output := $(output)api.game/

all: $(output)$(targer) \
	 $(output)$(tree) \
	 $(output)$(targer).json \

DIRS := $(shell find . -type d)
sources := $(foreach dir, $(DIRS), $(wildcard $(dir)/*.go))

$(output)$(targer) : $(sources)
	go build  $(BUILD_FLAG) -gcflags "-N -l" -o $(output)windp_$(targer) main.go 
	
$(output)$(tree) : $(DIRS)
	cp -r $(tree) $(output)

$(output)$(targer).json : $(targer).json
	cp $(targer).json $(output)